# Targets 
TARGET1=test_h2p

# Objects
OBJ1=test_h2p.o 

# Fortran compiler
FC=g95

# Linker
LD=$(FC)

# Libraries
NETCDF_INC=${INC_NETCDF}
NETCDF_LIB=${LIB_NETCDF}

#HDF5=/usr/local/hdf5/hdf-5.1.8.5

# Directory list to search for library files
LIBS=-L$(NETCDF_LIB) -lnetcdff  

# Compiler flags
#FFLAGS=-g -fbounds-check -fdefault-real-8 -I$(NETCDF)/include
FFLAGS=-fno-second-underscore -g -I$(NETCDF_INC)

# Linker flags
#LDFLAGS=$(LIBS) -g -fbounds-check
LDFLAGS=$(LIBS) 

.PHONY: all clean

all: $(TARGET1) 

clean:
	rm -f *.o  

$(TARGET1): $(OBJ1) 
	$(LD) -o $(TARGET1) $(OBJ1) $(LDFLAGS)

test_h2p.o: test_h2p.F
	$(FC) $(FFLAGS) -c test_h2p.F

